accidentEvent = {}
QMPlugin = accidentEvent


function accidentEvent.init()
    accidentEvent.paraConfig = {
        ["取消按钮"] = {344,484,444,793,"6F6D3D","29|124|7C7D4D,-20|115|747329,2|243|706E3E,20|100|ABE0FA,4|97|A8DDF4,-3|100|ADE2FD,5|136|ACE2FC,20|146|A2D3E7,-7|155|AADFF8",0,0.9},
    }
end

-- 判断取消按钮对话框
local function checkCancelBtn()
    local para = zhuaguiMgr.paraConfig["取消按钮"]
    local itemX,itemY = game.findMultiColor(utils.unpack(para))
    if itemX == -1 or itemY == - 1 then
        return false,itemX,itemY
    else
        return true,itemX,itemY
    end
end

function accidentEvent.check()
    local show,x,y = checkCancelBtn()
    if show then
        mlog.info("发现取消按钮，并取消")
        game.tap(x, y)
        game.delay(300)
    end
end

